package options

import (
	cliflag "github.com/marmotedu/component-base/pkg/cli/flag"

	genericopts "file-cleaner/internal/pkg/options"
)

type Options struct {
	Runtime *genericopts.RuntimeOptions
	Query   *genericopts.QueryOptions
	Clean   *genericopts.CleanOptions
	Log     *genericopts.LoggerOptions
}

func (o *Options) Flags() (fss cliflag.NamedFlagSets) {
	o.Runtime.AddFlags(fss.FlagSet("runtime"))
	o.Query.AddFlags(fss.FlagSet("query handlers"))
	o.Clean.AddFlags(fss.FlagSet("clean handlers"))
	o.Log.AddFlags(fss.FlagSet("log"))

	return fss
}

func NewOptions() *Options {
	return &Options{
		Runtime: genericopts.NewRuntimeOptions(),
		Query:   genericopts.NewQueryOptions(),
		Clean:   genericopts.NewCleanOptions(),
		Log:     genericopts.NewLoggerOptions(),
	}
}
